<!DOCTYPE html>
<html>
<head>
	<title>注册验证码</title>
</head>

<body >
	<div id="myDiv">
		<h1>欢迎您注册我们的网站！</h1>
        您的邮箱: <b>${email}</b>正在注册<a href="${ourSite}">我们的网站</a>
		<p>以下是您的注册验证码，请尽早完成注册，此验证码<span id="countdown">将在 180 秒后失效</span></p>
		<div id="captcha" class="captcha">${captcha}</div>
        <b class="warning">如非本人操作，请尽快更改邮箱密码</b>
	</div>
</body>

<script>
	// 倒计时
	window.onload=function () {
		var count = 60;
		var countdown = setInterval(function() {
			count--;
			document.getElementById("countdown").innerHTML = '将在 ' + count + ' 秒后失效';
			if (count<= 0) {
				clearInterval(countdown);
				document.getElementById("countdown").innerHTML = "已失效";
				document.getElementById("captcha").innerHTML = "";
			}
		}, 1000);
	}
</script>
</html>

<style>
#myDiv {
	width: 400px;
	height: 300px;
	background-color: #d0d0d0;
	border-radius: 10px;
	box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
	padding: 20px;
	margin: 50px auto;
	text-align: center;
}

h1 {
	font-size: 30px;
	color: #333333;
	margin-top: 0;
}

p {
	font-size: 24px;
	color: #666666;
	line-height: 1.5;
	margin-bottom: 20px;
}

.captcha {
	margin: 20px auto;
	width: 50%;
	height: 80px;
	text-align: center;
	background-color: antiquewhite;
	font-size: 48px;
	color: #666666;
	border: 2px solid #666666;
	border-radius: 10px;
    padding-top: 20px;
}

.warning {
	color: red;
	background-color: yellow;
	font-size: large;
}
</style>
